home *** CD-ROM | disk | FTP | other *** search
/ MACD 5 / MACD 5.bin / workbench / libs / intuisup.lha / Intuisup / source.lha / Library / libinit.c < prev    next >
C/C++ Source or Header  |  1992-07-11  |  3KB  |  153 lines

  1. /* $Revision Header *** Header built automatically - do not edit! ***********
  2.  *
  3.  *    (C) Copyright 1991 by Torsten Jürgeleit
  4.  *
  5.  *    Name .....: libinit.c
  6.  *    Created ..: Sunday 22-Dec-91 20:34:55
  7.  *    Revision .: 1
  8.  *
  9.  *    Date        Author                 Comment
  10.  *    =========   ====================   ====================
  11.  *    11-Jul-92   Torsten Jürgeleit      get pointer to console device
  12.  *                       in LibInit()
  13.  *    22-Dec-91   Torsten Jürgeleit      Created this file!
  14.  *
  15.  ****************************************************************************
  16.  *
  17.  *    Function table and init/free routine for IntuiSup library
  18.  *
  19.  * $Revision Header ********************************************************/
  20.  
  21.     /* Includes */
  22.  
  23. #include <exec/types.h>
  24. #include <libraries/dosextens.h>
  25. #include "/render/render.h"
  26. #include "/texts/texts.h"
  27. #include "/borders/borders.h"
  28. #include "/gadgets/gadgets.h"
  29. #include "/requester/requester.h"
  30. #include "/menus/menus.h"
  31. #include "/files/files.h"
  32. #include "/language/language.h"
  33. #include "/pointer/pointer.h"
  34.  
  35.     /* Imports from startup code */
  36.  
  37. IMPORT struct Library  *LibOpen(VOID);
  38. IMPORT BPTR LibClose(VOID);
  39. IMPORT BPTR LibExpunge(VOID);
  40. IMPORT VOID LibNull(VOID);
  41.  
  42.     /* Globals */
  43.  
  44. struct Device  *ConsoleDevice;
  45.  
  46. VOID *FuncTable[] = {    /* Library function table -> needed in DataTable of startup code */
  47.  
  48.     /* Standard system functions */
  49.     LibOpen,
  50.     LibClose,
  51.     LibExpunge,
  52.     LibNull,
  53.  
  54.     /* Render functions */
  55.     get_render_info,
  56.     free_render_info,
  57.     open_window,
  58.     clear_window,
  59.     close_window,
  60.     avail_fonts,
  61.     ask_font,
  62.     open_font,
  63.  
  64.     /* Text functions */
  65.     display_texts,
  66.     print_text,
  67.     convert_unsigned_dec,
  68.     convert_signed_dec,
  69.     convert_hex,
  70.     convert_bin,
  71.  
  72.     /* Border functions */
  73.     display_borders,
  74.     draw_border,
  75.  
  76.     /* Gadget functions */
  77.     create_gadgets,
  78.     free_gadgets,
  79.     display_gadgets,
  80.     refresh_gadgets,
  81.     modify_gadget,
  82.     set_gadget_attributes,
  83.     activate_input_gadget,
  84.     gadget_address,
  85.     remove_gadgets,
  86.     get_msg,
  87.     reply_msg,
  88.  
  89.     /* Requester functions */
  90.     auto_request,
  91.     display_requester,
  92.     remove_requester,
  93.  
  94.     /* Menu functions */
  95.     create_menu,
  96.     attach_menu,
  97.     menu_item_address,
  98.     remove_menu,
  99.     free_menu,
  100.  
  101.     /* Text file functions */
  102.     open_text_file,
  103.     read_text_line,
  104.     close_text_file,
  105.  
  106.     /* Language functions */
  107.     build_language_text_array,
  108.     get_language_text,
  109.     free_language_text_array,
  110.  
  111.     /* Mouse pointer functions */
  112.     change_mouse_pointer,
  113.     restore_mouse_pointer,
  114.     move_mouse_pointer,
  115.  
  116.     /* Gadget functions */
  117.     convert_rawkey_to_ascii,
  118.  
  119.     /* End marker */
  120.     (VOID *)-1
  121. };
  122.     /* Statics */
  123.  
  124. STATIC struct IOStdReq  io;
  125.  
  126.     /* Prototypes */
  127.  
  128. BOOL LibInit(VOID);
  129. VOID LibFree(VOID);
  130.  
  131.     /* Library specific init routine */
  132.  
  133.    BOOL
  134. LibInit(VOID)
  135. {
  136.    BOOL result = TRUE;
  137.  
  138.    /* Get pointer to console device */
  139.    if (OpenDevice("console.device", -1L, (struct IORequest *)&io, 0L)) {
  140.       result = FALSE;
  141.    } else {
  142.       ConsoleDevice = io.io_Device;
  143.    }
  144.    return(result);
  145. }
  146.     /* Library specific expunge routine */
  147.  
  148.    VOID
  149. LibFree(VOID)
  150. {
  151.    CloseDevice((struct IORequest *)&io);
  152. }
  153.